/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.event;

import dto.VideoEvent;
import java.text.SimpleDateFormat;
import java.util.ResourceBundle;
import javax.swing.JComponent;
import javax.swing.JLabel;
import map.MapManager;
import org.jdesktop.swingx.mapviewer.GeoPosition;

/**
 * Panel that represents a videoevent (note: video playback is not working!)
 * 
 * @author Pascal
 */
public class VideoEventPanel extends AbstractEventPanel {

    private VideoEvent event;

    public VideoEventPanel(VideoEvent event) {
        if (event == null) {
            throw new NullPointerException();
        }

        this.event = event;

        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm");

        labelTime.setText(formatter.format(event.getEventDate().getTime()));
        labelName.setText(event.getEventName());
        paintEventOnMap();
    }

    @Override
    public JComponent getContentComponent() {
        return new JLabel(ResourceBundle.getBundle("gui/guilabels").getString("videonotimplemented"));
    }

    @Override
    public String getContentLabelText() {
        return ResourceBundle.getBundle("gui/guilabels").getString("video");
    }

    @Override
    protected void paintEventOnMap() {

        MapManager mapManager = new MapManager(map);

        GeoPosition geoPos = new GeoPosition(event.getPos().getLanDeg(), event.getPos().getLonDeg());
        mapManager.drawTrack(event.getTrack().getTrackList());

        mapManager.paintGPSPoint(geoPos);
    }
}
